﻿using CleanArchitecture.Core.Interfaces;
using CleanArchitecture.Infrastructure.Entities;
using CleanArchitecture.Infrastructure.Entities.System.DataDic;
using System.Collections.Generic;

namespace CleanArchitecture.Infrastructure.Interfaces.SystemManage
{
    public interface ISystemDataDicService
    {
        /// <summary>
        /// Deletes an datadicnode
        /// </summary>
        /// <param name="datadicnode">Attribute</param>
        void DeleteSystemDataDicTree(SystemDataDicTree datadicnode);

        /// <summary>
        /// Gets an datadicnode
        /// </summary>
        /// <param name="datadictreeId">SystemDataDicTree identifier</param>
        /// <returns>An attribute</returns>
        SystemDataDicTree GetDataDicTreeById(int datadictreeId);

        /// <summary>
        /// Inserts an datadicnode
        /// </summary>
        /// <param name="datadicnode">attribute</param>
        void InsertSystemDataDicTree(SystemDataDicTree datadicnode);

        /// <summary>
        /// Updates the datadicnode
        /// </summary>
        /// <param name="datadicnode">SystemDataDicTree</param>
        void UpdateSystemDataDicTree(SystemDataDicTree datadicnode);

        /// <summary>
        /// Get datadicnodes
        /// </summary>
        /// <param name="groupkey">DataDicGroup</param>
        /// <returns>Get datadicnodes</returns>
        IList<SystemDataDicTree> GetDataDicTreeByGroupType(EntityEnumConfig.DataDicGroup groupkey, int? parentId = null);

        IList<SystemDataDicTree> GetSystemDataDicTreesAll();

        /// <summary>
        /// 根据父节点ID获取数据字典树，默认获取根节点
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        IList<SystemDataDicTree> GetSystemDataDicTreeByParentId(int parentId = 0);
        /// <summary>
        /// Get System DataDic by view page
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        IViewPagedList<SystemDataDicButton> GetSystemDataDicButtons(int fktreeId, int pageIndex = 0, int pageSize = int.MaxValue);
        /// <summary>
        /// Get All System DataDicButtons
        /// </summary>
        /// <returns></returns>
        IList<SystemDataDicButton> GetSystemDataDicButtonsAll();
        /// <summary>
        /// 通过Id数组获取数据字典中预定义按钮
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        IList<SystemDataDicButton> GetSystemDataDicButtonsByIds(int[] ids);
    }
}
